-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the error catching logic of should().throw() in audit.js #12606
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already reviewed downstream.
1dbd6cd
to
f265cff
Compare
@hoch, can you describe the exact situation, please, where the previous code Is there a case where a test needs to accept either of a simple exception or a AIUI the intention of #11983 was With this change, I don't see how a test could require that an exception is a If the expected exception is a simple exception, then wouldn't it be better for (It does look like the previous documentation "It can also be an instance of |
Please consider this example: After the previous change (#11983), the test above started failing. If the assertion only expects to see |
The assertion would have only expected to see That catches bugs like https://bugzilla.mozilla.org/show_bug.cgi?id=1472095 |
The previous change created ~10 test failures on our side. I don't have a strong opinion on this, but why do we want to care about |
The existing web platform tests were updated for the previous change. I would We care about DOMException specifically if the Web Audio API requires that a If no parameters were passed to throw() then AFAIK it was still generic enough If the Web Audio API requires that a simple exception such as TypeError is Are you saying that there was a problem logging the detail of the failure? |
If we really want to specific about the type of error of exception, we should prevent the I just did not have the context of this change, so this clarification really helped me understand. Please ignore what I said about "the detail of failure". |
How about something like this? should(someExpression).throw();
should(someExpression).throw(TypeError);
should(someExpression).throw(DOMException, 'NotSupportedError'); Basically |
f265cff
to
d16f5e3
Compare
That sounds fine to me, thank you. Mozilla is using audit.js with only Just so you are aware, that would be different syntax from the Line 1300 in f8ff0b7
The current syntax is already somewhat different, and so this is not a big deal, but (The other thing I notice in Line 1417 in f8ff0b7
|
That is a good point. However, we actually created audit.js because we did not like much about what the test harness offers. So diverging from the harness is not a big deal from our perspective. The latest patch I made (still working on WPT side) has this change and I think it's a bit clearer than we what had before. |
d16f5e3
to
851a3b5
Compare
851a3b5
to
b848489
Compare
Context: #12606 Change the logic of should.throw() so we can handle 3 cases - should(someExpression).throw(); should(someExpression).throw(TypeError); should(someExpression).throw(DOMException, 'NotSupportedError'); The generic error (except for DOMException) can be passed without the second argument, but this change will enforce the second arg when the expected error is a DOMException type. This touches many test files, so the work will be done in several steps: 1. Change audit.js on both locations (wpt, non-wpt) 2. Update affected test files with the script. 3. Update the rest of test files which can't be updated programmatically. Bug: 865614 Test: All layout tests pass. Change-Id: I16acacb26c194a0ff950aca05e931195bf55167f
b848489
to
e9a0b5e
Compare
Context: #12606 Change the logic of should.throw() so we can handle 3 cases - should(someExpression).throw(); should(someExpression).throw(TypeError); should(someExpression).throw(DOMException, 'NotSupportedError'); The generic error (except for DOMException) can be passed without the second argument, but this change will enforce the second arg when the expected error is a DOMException type. This touches many test files, so the work will be done in several steps: 1. Change audit.js, audionodeoptions.js on both locations. (wpt, non-wpt) 2. Update affected test files with the script. 3. Update the rest of test files which can't be updated programmatically. Bug: 865614 Test: All layout tests pass. Change-Id: I16acacb26c194a0ff950aca05e931195bf55167f
e9a0b5e
to
33048dc
Compare
Context: #12606 Change the logic of should.throw() so we can handle 3 cases - should(someExpression).throw(); should(someExpression).throw(TypeError); should(someExpression).throw(DOMException, 'NotSupportedError'); The generic error (except for DOMException) can be passed without the second argument, but this change will enforce the second arg when the expected error is a DOMException type. This touches many test files, so the work will be done in several steps: 1. Change audit.js, audionodeoptions.js on both locations. (wpt, non-wpt) 2. Update affected test files with the script. 3. Update the rest of test files which can't be updated programmatically. Bug: 865614 Test: All layout tests pass. Change-Id: I16acacb26c194a0ff950aca05e931195bf55167f
33048dc
to
cf2de7c
Compare
Context: #12606 Change the logic of should.throw() so we can handle 3 cases - should(someExpression).throw(); should(someExpression).throw(TypeError); should(someExpression).throw(DOMException, 'NotSupportedError'); The generic error (except for DOMException) can be passed without the second argument, but this change will enforce the second arg when the expected error is a DOMException type. This touches many test files, so the work will be done in several steps: 1. Change audit.js, audionodeoptions.js on both locations. (wpt, non-wpt) 2. Update affected test files with the script. 3. Update the rest of test files which can't be updated programmatically. Bug: 865614 Test: All layout tests pass. Change-Id: I16acacb26c194a0ff950aca05e931195bf55167f
cf2de7c
to
f749c8a
Compare
Context: #12606 Change the logic of should.throw() so we can handle 3 cases - should(someExpression).throw(); should(someExpression).throw(TypeError); should(someExpression).throw(DOMException, 'NotSupportedError'); The generic error (except for DOMException) can be passed without the second argument, but this change will enforce the second arg when the expected error is a DOMException type. This touches many test files, so the work will be done in several steps: 1. Change audit.js, audionodeoptions.js on both locations. (wpt, non-wpt) 2. Update affected test files with the script. 3. Update the rest of test files which can't be updated programmatically. Bug: 865614 Test: All layout tests pass. Change-Id: I16acacb26c194a0ff950aca05e931195bf55167f
Context: web-platform-tests/wpt#12606 Change the logic of should.throw() so we can handle 3 cases - should(someExpression).throw(); should(someExpression).throw(TypeError); should(someExpression).throw(DOMException, 'NotSupportedError'); The generic error (except for DOMException) can be passed without the second argument, but this change will enforce the second arg when the expected error is a DOMException type. This touches many test files, so the work will be done in several steps: 1. Change audit.js, audionodeoptions.js on both locations. (wpt, non-wpt) 2. Update affected test files with the script. 3. Update the rest of test files which can't be updated programmatically. Bug: 865614 Test: All layout tests pass. Change-Id: I16acacb26c194a0ff950aca05e931195bf55167f Reviewed-on: https://chromium-review.googlesource.com/1184146 Commit-Queue: Hongchan Choi <[email protected]> Reviewed-by: Raymond Toy <[email protected]> Cr-Commit-Position: refs/heads/master@{#587660}
Context: #12606 Change the logic of should.throw() so we can handle 3 cases - should(someExpression).throw(); should(someExpression).throw(TypeError); should(someExpression).throw(DOMException, 'NotSupportedError'); The generic error (except for DOMException) can be passed without the second argument, but this change will enforce the second arg when the expected error is a DOMException type. This touches many test files, so the work will be done in several steps: 1. Change audit.js, audionodeoptions.js on both locations. (wpt, non-wpt) 2. Update affected test files with the script. 3. Update the rest of test files which can't be updated programmatically. Bug: 865614 Test: All layout tests pass. Change-Id: I16acacb26c194a0ff950aca05e931195bf55167f Reviewed-on: https://chromium-review.googlesource.com/1184146 Commit-Queue: Hongchan Choi <[email protected]> Reviewed-by: Raymond Toy <[email protected]> Cr-Commit-Position: refs/heads/master@{#587660}
f749c8a
to
91a7ab3
Compare
This PR has not been merged automatically because the Firefox job is failing due to taking too long. (Travis timeout is 50 minutes.) Suspecting that might be because the tests were made broken (timeout) I tested some of the affected tests before and after the changes but couldn't observe any difference. So this is just #7660 again, I think. I'll force merge. This is a case where #7475 would have come in handy. |
….throw() in audit.js, a=testonly Automatic update from web-platform-testsFix the error catching logic of should().throw() in audit.js Context: web-platform-tests/wpt#12606 Change the logic of should.throw() so we can handle 3 cases - should(someExpression).throw(); should(someExpression).throw(TypeError); should(someExpression).throw(DOMException, 'NotSupportedError'); The generic error (except for DOMException) can be passed without the second argument, but this change will enforce the second arg when the expected error is a DOMException type. This touches many test files, so the work will be done in several steps: 1. Change audit.js, audionodeoptions.js on both locations. (wpt, non-wpt) 2. Update affected test files with the script. 3. Update the rest of test files which can't be updated programmatically. Bug: 865614 Test: All layout tests pass. Change-Id: I16acacb26c194a0ff950aca05e931195bf55167f Reviewed-on: https://chromium-review.googlesource.com/1184146 Commit-Queue: Hongchan Choi <[email protected]> Reviewed-by: Raymond Toy <[email protected]> Cr-Commit-Position: refs/heads/master@{#587660} -- wpt-commits: 4fd41de6ecf73b21534c81fc0f516defdca50ab1 wpt-pr: 12606
….throw() in audit.js, a=testonly Automatic update from web-platform-testsFix the error catching logic of should().throw() in audit.js Context: web-platform-tests/wpt#12606 Change the logic of should.throw() so we can handle 3 cases - should(someExpression).throw(); should(someExpression).throw(TypeError); should(someExpression).throw(DOMException, 'NotSupportedError'); The generic error (except for DOMException) can be passed without the second argument, but this change will enforce the second arg when the expected error is a DOMException type. This touches many test files, so the work will be done in several steps: 1. Change audit.js, audionodeoptions.js on both locations. (wpt, non-wpt) 2. Update affected test files with the script. 3. Update the rest of test files which can't be updated programmatically. Bug: 865614 Test: All layout tests pass. Change-Id: I16acacb26c194a0ff950aca05e931195bf55167f Reviewed-on: https://chromium-review.googlesource.com/1184146 Commit-Queue: Hongchan Choi <[email protected]> Reviewed-by: Raymond Toy <[email protected]> Cr-Commit-Position: refs/heads/master@{#587660} -- wpt-commits: 4fd41de6ecf73b21534c81fc0f516defdca50ab1 wpt-pr: 12606
….throw() in audit.js, a=testonly Automatic update from web-platform-testsFix the error catching logic of should().throw() in audit.js Context: web-platform-tests/wpt#12606 Change the logic of should.throw() so we can handle 3 cases - should(someExpression).throw(); should(someExpression).throw(TypeError); should(someExpression).throw(DOMException, 'NotSupportedError'); The generic error (except for DOMException) can be passed without the second argument, but this change will enforce the second arg when the expected error is a DOMException type. This touches many test files, so the work will be done in several steps: 1. Change audit.js, audionodeoptions.js on both locations. (wpt, non-wpt) 2. Update affected test files with the script. 3. Update the rest of test files which can't be updated programmatically. Bug: 865614 Test: All layout tests pass. Change-Id: I16acacb26c194a0ff950aca05e931195bf55167f Reviewed-on: https://chromium-review.googlesource.com/1184146 Commit-Queue: Hongchan Choi <hongchanchromium.org> Reviewed-by: Raymond Toy <rtoychromium.org> Cr-Commit-Position: refs/heads/master{#587660} -- wpt-commits: 4fd41de6ecf73b21534c81fc0f516defdca50ab1 wpt-pr: 12606 UltraBlame original commit: 650ffc22e4fef5b4d464b33a09663b47ceb620c5
….throw() in audit.js, a=testonly Automatic update from web-platform-testsFix the error catching logic of should().throw() in audit.js Context: web-platform-tests/wpt#12606 Change the logic of should.throw() so we can handle 3 cases - should(someExpression).throw(); should(someExpression).throw(TypeError); should(someExpression).throw(DOMException, 'NotSupportedError'); The generic error (except for DOMException) can be passed without the second argument, but this change will enforce the second arg when the expected error is a DOMException type. This touches many test files, so the work will be done in several steps: 1. Change audit.js, audionodeoptions.js on both locations. (wpt, non-wpt) 2. Update affected test files with the script. 3. Update the rest of test files which can't be updated programmatically. Bug: 865614 Test: All layout tests pass. Change-Id: I16acacb26c194a0ff950aca05e931195bf55167f Reviewed-on: https://chromium-review.googlesource.com/1184146 Commit-Queue: Hongchan Choi <hongchanchromium.org> Reviewed-by: Raymond Toy <rtoychromium.org> Cr-Commit-Position: refs/heads/master{#587660} -- wpt-commits: 4fd41de6ecf73b21534c81fc0f516defdca50ab1 wpt-pr: 12606 UltraBlame original commit: 650ffc22e4fef5b4d464b33a09663b47ceb620c5
….throw() in audit.js, a=testonly Automatic update from web-platform-testsFix the error catching logic of should().throw() in audit.js Context: web-platform-tests/wpt#12606 Change the logic of should.throw() so we can handle 3 cases - should(someExpression).throw(); should(someExpression).throw(TypeError); should(someExpression).throw(DOMException, 'NotSupportedError'); The generic error (except for DOMException) can be passed without the second argument, but this change will enforce the second arg when the expected error is a DOMException type. This touches many test files, so the work will be done in several steps: 1. Change audit.js, audionodeoptions.js on both locations. (wpt, non-wpt) 2. Update affected test files with the script. 3. Update the rest of test files which can't be updated programmatically. Bug: 865614 Test: All layout tests pass. Change-Id: I16acacb26c194a0ff950aca05e931195bf55167f Reviewed-on: https://chromium-review.googlesource.com/1184146 Commit-Queue: Hongchan Choi <hongchanchromium.org> Reviewed-by: Raymond Toy <rtoychromium.org> Cr-Commit-Position: refs/heads/master{#587660} -- wpt-commits: 4fd41de6ecf73b21534c81fc0f516defdca50ab1 wpt-pr: 12606 UltraBlame original commit: 650ffc22e4fef5b4d464b33a09663b47ceb620c5
Context: #12606
Change the logic of should.throw() so we can handle 3 cases -
should(someExpression).throw();
should(someExpression).throw(TypeError);
should(someExpression).throw(DOMException, 'NotSupportedError');
The generic error (except for DOMException) can be passed without
the second argument, but this change will enforce the second arg
when the expected error is a DOMException type.
This touches many test files, so the work will be done in several
steps:
(wpt, non-wpt)
programmatically.
Bug: 865614
Test: All layout tests pass.
Change-Id: I16acacb26c194a0ff950aca05e931195bf55167f
Reviewed-on: https://chromium-review.googlesource.com/1184146
Commit-Queue: Hongchan Choi [email protected]
Reviewed-by: Raymond Toy [email protected]
Cr-Commit-Position: refs/heads/master@{#587660}